package cn.itcast.tanhua.api;

import cn.itcast.model.Announcement;
import cn.itcast.tanhua.mapper.AnnouncementsMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


@DubboService
public class AnnouncementsApiImpl implements AnnouncementsApi {

    @Autowired
    private AnnouncementsMapper announcementsMapper;

    @Override
    public List<Announcement> announcements(Integer page, Integer pagesize) {
        QueryWrapper<Announcement> qw = new QueryWrapper<>();
        qw.orderByDesc("updated");
        return  announcementsMapper.selectList(qw);
    }
}
